package com.example.demo.exception;

import com.example.demo.enums.ErrorEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 自定义异常
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class ZException extends Exception {

    private String code;

    private String message;

    private Exception exception;

    public ZException(String message) {
        super(message);
    }

    public ZException(String message, Exception e) {
        super(message);
        this.exception = e;
    }

    public ZException(ErrorEnum errorEnum) {
        super(errorEnum.getValue());
        this.code = code;
    }

}
